home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 100
/
FreelogNo100-NovembreDecembre2010.iso
/
Musique
/
solfege
/
solfege-win32-3.17.0.exe
/
{app}
/
bin
/
Lib
/
site-packages
/
pygtk.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2010-05-04
|
2KB
|
67 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
import fnmatch
import glob
import os
import os.path as os
import sys
__all__ = [
'require']
_our_dir = os.path.dirname(os.path.abspath(os.path.normpath(__file__)))
_pygtk_2_0_dir = os.path.normpath('%s/gtk-2.0' % _our_dir)
_pygtk_dir_pat = 'gtk-[0-9].[0-9]'
_pygtk_required_version = None
def _get_available_versions():
versions = { }
for dir in sys.path:
if not dir:
dir = os.getcwd()
if not os.path.isdir(dir):
continue
if fnmatch.fnmatchcase(os.path.basename(dir), _pygtk_dir_pat):
continue
for filename in glob.glob(os.path.join(dir, _pygtk_dir_pat)):
pathname = os.path.join(dir, filename)
if not os.path.isdir(pathname):
continue
if not os.listdir(pathname):
continue
if not versions.has_key(filename[-3:]):
versions[filename[-3:]] = pathname
continue
return versions
def require20():
if _pygtk_2_0_dir not in sys.path:
sys.path.insert(0, _pygtk_2_0_dir)
def require(version):
global _pygtk_required_version
if version == '2.0':
return require20()
if _pygtk_required_version != None:
return None
versions = _get_available_versions()
for dir in sys.path:
if fnmatch.fnmatchcase(os.path.basename(dir), _pygtk_dir_pat):
sys.path.remove(dir)
continue
sys.path.insert(0, versions[version])
_pygtk_required_version = version